package com.huakang.controller;

import com.huakang.entity.Account;

import com.huakang.entity.Reginform;
import com.huakang.service.ReginfornService;
import com.huakang.utils.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/regin")
public class reginform {
    @Autowired
    private ReginfornService reginfornService;
    @PostMapping("/addregin")
    public ResultVo reg(@RequestBody Reginform reginform){
        final boolean addregin = reginfornService.addregin(reginform);
        if(addregin){
            return ResultVo.success("挂号成功");
        }return ResultVo.fail("挂号失败");
    }
    @GetMapping("/selectbypid")
    public ResultVo selectbypid(Integer pid){
        return ResultVo.success("查询成功",reginfornService.selectbypid(pid));
    }

    @GetMapping("/selectbydid")
    public ResultVo selectbydid(Integer did){

        return ResultVo.success("查询成功",reginfornService.selectbydid(did));
    }

}
